﻿namespace RegExpRegExpGenerator
{
    public class LexRule
    {
        /// <summary>
        ///     Lexer rule
        /// </summary>
        /// <param name="name">ID</param>
        /// <param name="pattern">Regex</param>
        public LexRule(string name, string pattern, bool ignored)
        {
            Name = name;
            Pattern = pattern;
            Ignored = ignored;
        }

        public string Name { get; set; }
        public string Pattern { get; set; }
        public bool Ignored { get; set; }

        /// <summary>
        ///     ToString for list box
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            if (Ignored)
            {
                return "(Ignore) " + Name + ", " + Pattern;
            }
            return Name + ", " + Pattern;
        }
    }
}